package com.ruoyi.product.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.product.mapper.ProdImageMapper;
import com.ruoyi.product.domain.ProdImage;
import com.ruoyi.product.service.IProdImageService;

import javax.annotation.Resource;

/**
 * 图片Service业务层处理
 * 

 * @date 2023-07-20
 */
@Service
public class ProdImageServiceImpl implements IProdImageService 
{


    @Resource
    private ProdImageMapper prodImageMapper;

    /**
     * 查询图片
     * 
     * @param id 图片主键
     * @return 图片
     */
    @Override
    public ProdImage selectProdImageById(Long id)
    {
        return prodImageMapper.selectProdImageById(id);
    }

    /**
     * 查询普通商品图片列表
     * 
     * @param prodImage 图片
     * @return 图片
     */
    @Override
    public List<ProdImage> selectProdImageList(ProdImage prodImage)
    {
        return prodImageMapper.selectProdImageList(prodImage);
    }

    /**
     * 查询轮播图片列表
     * @return 图片
     */
    @Override
    public List<ProdImage> selectSlideshowList() {
        // 调用数据访问层方法查询轮播图数据
        return prodImageMapper.selectSlideshowList();
    }

    /**
     * 新增图片
     * 
     * @param prodImage 图片
     * @return 结果
     */
    @Override
    public int insertProdImage(ProdImage prodImage)
    {
        return prodImageMapper.insertProdImage(prodImage);
    }

    /**
     * 修改图片
     * 
     * @param prodImage 图片
     * @return 结果
     */
    @Override
    public int updateProdImage(ProdImage prodImage)
    {
        return prodImageMapper.updateProdImage(prodImage);
    }

    /**
     * 批量删除图片
     * 
     * @param ids 需要删除的图片主键
     * @return 结果
     */
    @Override
    public int deleteProdImageByIds(Long[] ids)
    {
        return prodImageMapper.deleteProdImageByIds(ids);
    }

    /**
     * 删除图片信息
     * 
     * @param id 图片主键
     * @return 结果
     */
    @Override
    public int deleteProdImageById(Long id)
    {
        return prodImageMapper.deleteProdImageById(id);
    }

    @Override
    public List<ProdImage> selectProdImageByProId(Long id) {
        return prodImageMapper.selectProdImageByProId(id);
    }
}
